<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
<head> 
<title>Scuola Media E. d'Arborea - Lamarmora </title> 
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 
<meta name="description" content="Il sito della scuola secondaria superiore di Iglesias, in Sardegna" /> 
<meta name="keywords" content="scuola, iglesias, didattica, insegnamento, docenti" /> 
<link rel="stylesheet" href="andreas08.css" type="text/css" media="screen,projection" />
<script type="text/javascript" src="/js/prototype.js"></script> 
<script src="/js/scriptaculous.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/page.js"></script> 
<script type="text/javascript">
function new_act(id, mod){
	if(mod == 0){
		alert("Attivita' non modificabile");
		return false;
	}
	act = window.open_centered("dettaglio_attivita.php?t="+id, "aaa", 400, 300, "");
}
</script>
</head> 
 
<body> 
<div id="container" > 
 
<div id="header"> 
<h1>Scuola Media E. d'Arborea - Lamarmora</h1> 
<h2>area riservata ai docenti</h2> 
</div> 
 
<?php include "navigation.php" ?>
<div id="content"> 
<h2 style="text-align: center"><?php print "Classe ".$_SESSION['__classe__']->get_anno().$_SESSION['__classe__']->get_sezione()." - ".$_SESSION['__current_year__']->to_string() ?></h2> 

<?php 
if($res_act->num_rows < 1){
?>
<div style="width: 100%; margin-left: auto; margin-right: auto; margin-top: 40px; font-size: 12px; font-weight: bold; text-align: center">
Nessuna attivit&agrave; presente.
</div>
<?php 
}
else{
?>
<table style="width: 100%; margin-left: auto; margin-right: auto" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="5" style="text-align: center; border-width: 1px 1px 1px 1px; border-style: solid; border-color: #c0c0c0; font-weight: bold; font-size: 12px">Attivit&agrave; programmate (<a href="<?php print $link ?>" style="font-weight: normal"><?php print $label ?></a>)</td>	
	</tr>
	<tr>
		<td style="width: 50%; text-align: center; font-weight: bold; border-width: 0px 0px 1px 1px; border-style: solid; border-color: #c0c0c0;">Attivit&agrave;</td>
		<td style="width: 10%; text-align: center; font-weight: bold; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #c0c0c0;">Assegnata</td>
		<td style="width: 10%; text-align: center; font-weight: bold; border-width: 0px 1px 1px 0px; border-style: solid; border-color: #c0c0c0;">Materia</td>
		<td style="width: 15%; text-align: center; font-weight: bold; border-width: 0px 1px 1px 0px; border-style: solid; border-color: #c0c0c0;">Inizia</td>
		<td style="width: 15%; text-align: center; font-weight: bold; border-width: 0px 1px 1px 0px; border-style: solid; border-color: #c0c0c0;">Termina</td>
	</tr>
<?php 
	$idx = 1;
	while($act = $res_act->fetch_assoc()){
		$bc = "";
		if(($idx%2) != 0)
			$bc = "background-color: #e8eaec; ";
		list($da, $oa) = explode(" ", $act['data_assegnazione']);
		list($di, $oi) = explode(" ", $act['data_inizio']);
		list($df, $of) = explode(" ", $act['data_fine']);
		$desc = $act['descrizione'];
		if($act['note'] != "")
			$desc .= " (".$act['note'].")";
		$mod = 1;
		if($_SESSION['__user__']->getUid() != $act['docente'])
			$mod = 0;
			
?>
	<tr>
		<td style="<?php print $bc ?>width: 50%; text-align: left; font-weight: normal; border-width: 0px 0px 1px 1px; border-style: solid; padding-left: 5px; border-color: #c0c0c0;"><a style="color: #303030; font-weight: normal" href="#" onclick="new_act(<?php print $act['id_impegno'] ?>, <?php print $mod ?>)"><?php print $desc ?></a></td>
		<td style="<?php print $bc ?>width: 10%; text-align: left; font-weight: normal; border-width: 0px 1px 1px 1px; border-style: solid; padding-left: 5px; border-color: #c0c0c0;"><?php print format_date($da, SQL_DATE_STYLE, IT_DATE_STYLE, "/") ?></td>
		<td style="<?php print $bc ?>width: 10%; text-align: center; font-weight: normal; border-width: 0px 1px 1px 0px; border-style: solid; border-color: #c0c0c0;"><?php print $act['mat'] ?></td>
		<td style="<?php print $bc ?>width: 15%; text-align: center; font-weight: normal; border-width: 0px 1px 1px 0px; border-style: solid; border-color: #c0c0c0;"><?php print format_date($di, SQL_DATE_STYLE, IT_DATE_STYLE, "/")." ".substr($oi, 0, 5) ?></td>
		<td style="<?php print $bc ?>width: 15%; text-align: center; font-weight: normal; border-width: 0px 1px 1px 0px; border-style: solid; border-color: #c0c0c0;"><?php print format_date($df, SQL_DATE_STYLE, IT_DATE_STYLE, "/")." ".substr($of, 0, 5) ?></td>
	</tr>
<?php 
		$idx++;
	}
?>
</table>
<?php 
}
?>
<div style="width: 100%; margin-left: auto; margin-right: auto; margin-top: 40px; font-size: 12px; font-weight: bold; text-align: right">
<input type="button" value="Nuova attivit&agrave;" onclick="new_act(0)" style="margin-right: 0px; border: 1px solid #c0c0c0; font-size: 11px; padding: 5px" />
</div> 
<div class="splitcontentleft"> 

<p>&nbsp;</p>
 

</div> 
 
 
</div> 
 
<div id="subcontent"> 
<?php include 'smallbox.php'; ?>
 
<?php include "class_working.php" ?>


</div> 
 
<?php include "footer.php" ?>
 
</div> 
</body> 
</html>